using System;
using System.Collections.Generic;
using System.Text;
using OrtzEng.Graphics;
using Microsoft.Xna.Framework;

namespace OrtzEng.Physics
{
    public abstract class Entity : Sprite
    {
        private BoundingBox2D _boundingBox;
        public BoundingBox2D BoundingBox
        {
            get { return _boundingBox; }
        }

        private Vector2 mVelocity;
        public Vector2 Velocity
        {
            get { return mVelocity; }
            set { mVelocity = value; }
        }

        public override Vector2 Position
        {
            set
            {
                this._boundingBox = new BoundingBox2D(new Vector2(value.X, value.Y), this.BoundingBox.Width, this.BoundingBox.Height);
                base.Position = value;
            }
        }

        public Entity(float width, float height, string texturePath) : base(texturePath)
        {
            _boundingBox = new BoundingBox2D(width, height);
            this.Size = new Vector2(width, height);
            _texturePath = texturePath;
        }

        public override void Move(Vector2 position)
        {
            _boundingBox.Move(position);
            base.Move(position);
        }
        public override void Bump(Vector2 increment)
        {
            _boundingBox.Bump(increment);
            base.Bump(increment);
        }
        public abstract void OnCollision(Entity other, Vector2 displacement);
    }
}
